import sys
print 'dive in'
saveout = open('out.log','w')
sys.stdout = saveout
print 'This message will be logged instead of displayed.'
saveout.close()

